Class symantec.itools.awt.Slider
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class symantec.itools.awt.Slider

Object
   |
   +----Component
           |
           +----Canvas
                   |
                   +----symantec.itools.awt.Slider

public abstract class Slider
extends Canvas
Components based on this class are used to select one value from a continuous range of values. It has a movable thumb in front of a gauge with ticks marks on it.

Version:
1.1, July 17, 1997
Author:
Symantec
See Also:
HorizontalSlider, VerticalSlider

Variable Index

 o BORDER_X
Drawing constant for the horizontal axis.
 o BORDER_Y
Drawing constant for the vertical axis.
 o TICK_BOTH
Defines the slider tick style where the tick marks appear both to the left and right of the slider thumb.
 o TICK_BOTTOM
Defines the slider tick style where the tick marks appear below the slider thumb.
 o TICK_LEFT
Defines the slider tick style where the tick marks appear to the left of the slider thumb.
 o TICK_NONE
Defines the slider tick style where no tick marks are drawn.
 o TICK_RIGHT
Defines the slider tick style where the tick marks appear to the right of the slider thumb.
 o TICK_TOP
Defines the slider tick style where the tick marks appear above the slider thumb.
 o actionCommand
The command name of the action event fired by this component.
 o actionListener
The action listener to keep track of listeners for our action event.
 o cachedSize
The size of the component, the last time paint was called.
 o curPos
The current position of the slider thumb.
 o errors
Error strings.
 o forceCallDoReshape
Set if paint override should call DoReshape, even if the size has not changed.
 o freq
The current tick mark display frequency.
 o height
The current component height.
 o isAdded
is the component added to a container hierarchy?
 o max
The maximum value of the slider range.
 o min
The minimum value of the slider range.
 o prevPos
The position of the slider thumb last time control painted.
 o showBorder
Flag indicating if border should be drawn.
 o style
The current slider tick mark style.
 o tempMaxValue
Internal use.
 o tempMinValue
Internal use.
 o tempTickFreq
Internal use.
 o tempValue
Internal use.
 o tick
The tick marks for this slider.
 o width
The current component width.

Constructor Index

 o symantec.itools.awt.Slider()
Constructs the Slider.

Method Index

 o addActionListener(ActionListener)
Adds the specified action listener to receive action events from this component.
 o addMaxValueListener(PropertyChangeListener)
Adds a listener for the max property changes.
 o addMaxValueListener(VetoableChangeListener)
Adds a vetoable listener for the max property changes.
 o addMinValueListener(PropertyChangeListener)
Adds a listener for the min property changes.
 o addMinValueListener(VetoableChangeListener)
Adds a vetoable listener for the min property changes.
 o addNotify()
Tells this component that it has been added to a container.
 o addPropertyChangeListener(PropertyChangeListener)
Adds a listener for all event changes.
 o addVetoableChangeListener(VetoableChangeListener)
Adds a vetoable listener for all event changes.
 o doMove(int, boolean)
This routine updates the thumb position, paints the Slider, and posts a new action event as needed.
 o do_reshape(int, int)
This abstract function is called by reshape.
 o getActionCommand()
 o getMaxValue()
Returns the current maximum value of the slider.
 o getMinValue()
Returns the current minimum value of the slider.
 o getShowBorder()
 o getTickFreq()
Returns the current tick mark display frequency.
 o getTickStyle()
Returns the current slider tick mark style.
 o getValue()
Returns the current slider value.
 o isShowBorder()
Returns the current border display flag.
 o isValidMaxValue(int)
Is the given value valid for the Max property .
 o isValidMinValue(int)
Is the given value valid for the Min property .
 o moveThumb(int, boolean)
Handles the mouse pressing or dragging this component's thumb.
 o paint(Graphics)
 o removeActionListener(ActionListener)
Removes the specified action listener so it no longer receives action events from this component.
 o removeMaxValueListener(PropertyChangeListener)
Removes a listener for the max property changes.
 o removeMaxValueListener(VetoableChangeListener)
Removes a vetoable listener for the max property changes.
 o removeMinValueListener(PropertyChangeListener)
Removes a listener for the min property changes.
 o removeMinValueListener(VetoableChangeListener)
Removes a vetoable listener for the min property changes.
 o removeNotify()
Tells this component that it is being removed from a container.
 o removePropertyChangeListener(PropertyChangeListener)
Removes a listener for all event changes.
 o removeVetoableChangeListener(VetoableChangeListener)
Removes a vetoable listener for all event changes.
 o setActionCommand(String)
Sets the command name of the action event fired by this component.
 o setMaxValue(int)
Sets the maximum value of the slider.
 o setMinValue(int)
Sets the minimum value of the slider.
 o setShowBorder(boolean)
Sets the border display flag.
 o setTickFreq(int)
Sets the tick mark display frequency.
 o setTickStyle(int)
Sets the current slider tick mark style.
 o setValue(int)
Sets the slider value.
 o sourceActionEvent()
Fire an action event to the listeners
 o verifyContstrainedPropertyValues()
Called after addNotify to set the internally constrined properties to their temporary values to validate them now that the component has been added to the form.

Variables

 o BORDER_X
protected static final int BORDER_X
Drawing constant for the horizontal axis.

 o BORDER_Y
protected static final int BORDER_Y
Drawing constant for the vertical axis.

 o TICK_BOTH
public static final int TICK_BOTH
Defines the slider tick style where the tick marks appear both to the left and right of the slider thumb.

 o TICK_BOTTOM
public static final int TICK_BOTTOM
Defines the slider tick style where the tick marks appear below the slider thumb.

 o TICK_LEFT
public static final int TICK_LEFT
Defines the slider tick style where the tick marks appear to the left of the slider thumb.

 o TICK_NONE
public static final int TICK_NONE
Defines the slider tick style where no tick marks are drawn.

 o TICK_RIGHT
public static final int TICK_RIGHT
Defines the slider tick style where the tick marks appear to the right of the slider thumb.

 o TICK_TOP
public static final int TICK_TOP
Defines the slider tick style where the tick marks appear above the slider thumb.

 o actionCommand
protected java.lang.String actionCommand
The command name of the action event fired by this component.

 o actionListener
protected java.awt.event.ActionListener actionListener
The action listener to keep track of listeners for our action event.

 o cachedSize
protected java.awt.Dimension cachedSize
The size of the component, the last time paint was called.

 o curPos
protected int curPos
The current position of the slider thumb.

 o errors
protected transient java.util.ResourceBundle errors
Error strings.

 o forceCallDoReshape
protected boolean forceCallDoReshape
Set if paint override should call DoReshape, even if the size has not changed.

 o freq
protected int freq
The current tick mark display frequency.

 o height
protected int height
The current component height.

 o isAdded
protected boolean isAdded
is the component added to a container hierarchy?

 o max
protected int max
The maximum value of the slider range.

 o min
protected int min
The minimum value of the slider range.

 o prevPos
protected int prevPos
The position of the slider thumb last time control painted.

 o showBorder
protected boolean showBorder
Flag indicating if border should be drawn.

 o style
protected int style
The current slider tick mark style.

 o tempMaxValue
protected int tempMaxValue
Internal use. Max value stored until this component is added to a container. It is then used to set the real property value. This avoids code-gen order dependencies.

 o tempMinValue
protected int tempMinValue
Internal use. Min value stored until this component is added to a container. It is then used to set the real property value. This avoids code-gen order dependencies.

 o tempTickFreq
protected int tempTickFreq
Internal use. Tick frequency value stored until this component is added to a container. It is then used to set the real property value. This avoids code-gen order dependencies.

 o tempValue
protected int tempValue
Internal use. Slider value stored until this component is added to a container. It is then used to set the real property value. This avoids code-gen order dependencies.

 o tick
protected transient symantec.itools.awt.SliderTick[] tick
The tick marks for this slider.

 o width
protected int width
The current component width.

Constructors

 o Slider
protected Slider()
Constructs the Slider.

Methods

 o addActionListener
public synchronized void addActionListener(ActionListener l)
Adds the specified action listener to receive action events from this component.

Parameters:
l - the action listener
 o addMaxValueListener
public synchronized void addMaxValueListener(PropertyChangeListener listener)
Adds a listener for the max property changes.

Parameters:
listener - the listener to add.
See Also:
removeMaxValueListener(java.beans.PropertyChangeListener)
 o addMaxValueListener
public synchronized void addMaxValueListener(VetoableChangeListener listener)
Adds a vetoable listener for the max property changes.

Parameters:
listener - the listener to add.
See Also:
removeMaxValueListener(java.beans.VetoableChangeListener)
 o addMinValueListener
public synchronized void addMinValueListener(PropertyChangeListener listener)
Adds a listener for the min property changes.

Parameters:
listener - the listener to add.
See Also:
removeMinValueListener(java.beans.PropertyChangeListener)
 o addMinValueListener
public synchronized void addMinValueListener(VetoableChangeListener listener)
Adds a vetoable listener for the min property changes.

Parameters:
listener - the listener to add.
See Also:
removeMinValueListener(java.beans.VetoableChangeListener)
 o addNotify
public synchronized void addNotify()
Tells this component that it has been added to a container. This is a standard Java AWT method which gets called by the AWT when this component is added to a container. Typically, it is used to create this component's peer. It has been overridden here to hook-up event listeners. It is also used to setup the component, creating the TextField as needed.

Overrides:
addNotify in class Canvas
See Also:
removeNotify
 o addPropertyChangeListener
public synchronized void addPropertyChangeListener(PropertyChangeListener listener)
Adds a listener for all event changes.

Parameters:
listener - the listener to add.
See Also:
removePropertyChangeListener
 o addVetoableChangeListener
public synchronized void addVetoableChangeListener(VetoableChangeListener listener)
Adds a vetoable listener for all event changes.

Parameters:
listener - the listener to add.
See Also:
removeVetoableChangeListener
 o doMove
protected void doMove(int pos,
                      boolean forcePost)
This routine updates the thumb position, paints the Slider, and posts a new action event as needed. If the thumb position has changed or the forcePost parameter is true the component will be painted and an action event posted.

Parameters:
pos - the new thumb position
forcePost - true forces painting the slider and posting of an action event even if the thumb position hasn't changed
 o do_reshape
protected abstract void do_reshape(int w,
                                   int h)
This abstract function is called by reshape. Override it to change the way the Slider is reshaped.

 o getActionCommand
public java.lang.String getActionCommand()

Returns:
the command name of the action event fired by this component.
 o getMaxValue
public int getMaxValue()
Returns the current maximum value of the slider.

See Also:
setMaxValue, getMinValue
 o getMinValue
public int getMinValue()
Returns the current minimum value of the slider.

See Also:
setMinValue, getMaxValue
 o getShowBorder
public boolean getShowBorder()
Note: getShowBorder() is deprecated.

See Also:
isShowBorder
 o getTickFreq
public int getTickFreq()
Returns the current tick mark display frequency. This is the range in value between each tick mark.

Returns:
the range in value between tick marks
See Also:
setTickFreq
 o getTickStyle
public int getTickStyle()
Returns the current slider tick mark style.

Returns:
one of: TICK_LEFT, TICK_RIGHT, TICK_TOP, TICK_BOTTOM, TICK_BOTH, or TICK_NONE
See Also:
TICK_LEFT, TICK_RIGHT, TICK_TOP, TICK_BOTTOM, TICK_BOTH, TICK_NONE
 o getValue
public int getValue()
Returns the current slider value.

See Also:
setValue
 o isShowBorder
public boolean isShowBorder()
Returns the current border display flag.

Returns:
true if the border is visible
See Also:
setShowBorder, getShowBorder
 o isValidMaxValue
protected boolean isValidMaxValue(int i)
Is the given value valid for the Max property .

Parameters:
i - the given value
Returns:
true if the given value is acceptable, false if not.
 o isValidMinValue
protected boolean isValidMinValue(int i)
Is the given value valid for the Min property .

Parameters:
i - the given value
Returns:
true if the given value is acceptable, false if not.
 o moveThumb
protected void moveThumb(int i,
                         boolean forcePost)
Handles the mouse pressing or dragging this component's thumb. It is not typically called directly.

Parameters:
i - the mouse horizontal or vertical position coordinate
forcePost - true forces painting the slider and posting of an action event even if the thumb position hasn't changed
 o paint
public void paint(Graphics g)
Overrides:
paint in class Canvas
 o removeActionListener
public synchronized void removeActionListener(ActionListener l)
Removes the specified action listener so it no longer receives action events from this component.

Parameters:
l - the action listener
 o removeMaxValueListener
public synchronized void removeMaxValueListener(PropertyChangeListener listener)
Removes a listener for the max property changes.

Parameters:
listener - the listener to remove.
See Also:
addMaxValueListener(java.beans.PropertyChangeListener)
 o removeMaxValueListener
public synchronized void removeMaxValueListener(VetoableChangeListener listener)
Removes a vetoable listener for the max property changes.

Parameters:
listener - the listener to remove.
See Also:
addMaxValueListener(java.beans.VetoableChangeListener)
 o removeMinValueListener
public synchronized void removeMinValueListener(PropertyChangeListener listener)
Removes a listener for the min property changes.

Parameters:
listener - the listener to remove.
See Also:
addMinValueListener(java.beans.PropertyChangeListener)
 o removeMinValueListener
public synchronized void removeMinValueListener(VetoableChangeListener listener)
Removes a vetoable listener for the min property changes.

Parameters:
listener - the listener to remove.
See Also:
addMinValueListener(java.beans.VetoableChangeListener)
 o removeNotify
public synchronized void removeNotify()
Tells this component that it is being removed from a container. This is a standard Java AWT method which gets called by the AWT when this component is removed from a container. Typically, it is used to destroy the peers of this component and all its subcomponents. It has been overridden here to unhook event listeners.

Overrides:
removeNotify in class Component
See Also:
addNotify
 o removePropertyChangeListener
public synchronized void removePropertyChangeListener(PropertyChangeListener listener)
Removes a listener for all event changes.

Parameters:
listener - the listener to remove.
See Also:
addPropertyChangeListener
 o removeVetoableChangeListener
public synchronized void removeVetoableChangeListener(VetoableChangeListener listener)
Removes a vetoable listener for all event changes.

Parameters:
listener - the listener to remove.
See Also:
addVetoableChangeListener
 o setActionCommand
public void setActionCommand(String command) throws PropertyVetoException
Sets the command name of the action event fired by this component.

Parameters:
command - The name of the action event command fired by this component
Throws: PropertyVetoException
if the specified property value is unacceptable
 o setMaxValue
public void setMaxValue(int max) throws PropertyVetoException
Sets the maximum value of the slider.

Parameters:
max - the new maximum slider value
Throws: PropertyVetoException
if the specified property value is unacceptable
See Also:
getMaxValue, setMinValue
 o setMinValue
public void setMinValue(int min) throws PropertyVetoException
Sets the minimum value of the slider.

Parameters:
min - the new minimum slider value
Throws: PropertyVetoException
if the specified property value is unacceptable
See Also:
getMinValue, setMaxValue
 o setShowBorder
public void setShowBorder(boolean f) throws PropertyVetoException
Sets the border display flag.

Parameters:
f - true for the border to show
Throws: PropertyVetoException
if the specified property value is unacceptable
See Also:
getShowBorder
 o setTickFreq
public void setTickFreq(int freq) throws PropertyVetoException
Sets the tick mark display frequency. This is the range in value between each tick mark.

Parameters:
freq - the range in value between tick marks
Throws: PropertyVetoException
if the specified property value is unacceptable
See Also:
getTickFreq
 o setTickStyle
public void setTickStyle(int style) throws PropertyVetoException
Sets the current slider tick mark style.

Parameters:
style - the new tick mark style, one of TICK_LEFT, TICK_RIGHT, TICK_TOP, TICK_BOTTOM, TICK_BOTH, or TICK_NONE
Throws: PropertyVetoException
if the specified property value is unacceptable
See Also:
getTickStyle, TICK_LEFT, TICK_RIGHT, TICK_TOP, TICK_BOTTOM, TICK_BOTH, TICK_NONE
 o setValue
public void setValue(int pos) throws PropertyVetoException
Sets the slider value.

Parameters:
pos - the new slider value
Throws: PropertyVetoException
if the specified property value is unacceptable
See Also:
getValue
 o sourceActionEvent
protected void sourceActionEvent()
Fire an action event to the listeners

 o verifyContstrainedPropertyValues
protected void verifyContstrainedPropertyValues()
Called after addNotify to set the internally constrined properties to their temporary values to validate them now that the component has been added to the form. This is used to avoid code-gen order dependencies, since VC generates all property manipulating code before adding the component to its container. Subclasses should override this function for any internally constrained properties, and call the super version in the overridden version.


All Packages  Class Hierarchy  This Package  Previous  Next  Index